package com.whut.customer.controller;

import com.whut.common.util.R;
import com.whut.customer.constant.EnumConstant;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 光纤沉降仪 前端控制器
 * </p>
 *
 * @author author
 * @since 2021-05-19
 */
@RestController
@CrossOrigin
@RequestMapping("/settleMonitor")
public class SettleMonitorController {

    @ApiOperation("显示沉降值")
    @PostMapping("/displaySettle")
    public R displaySettle() {
        List<Map<String, Double[]>> mapList = new ArrayList<>();
        HashMap<String, Double[]> map1 = new HashMap<>();
        HashMap<String, Double[]> map2 = new HashMap<>();
        HashMap<String, Double[]> map3 = new HashMap<>();
        HashMap<String, Double[]> map4 = new HashMap<>();
        HashMap<String, Double[]> map5 = new HashMap<>();
        HashMap<String, Double[]> map6 = new HashMap<>();
        HashMap<String, Double[]> map7 = new HashMap<>();
        HashMap<String, Double[]> map8 = new HashMap<>();
        HashMap<String, Double[]> map9 = new HashMap<>();
        HashMap<String, Double[]> map10 = new HashMap<>();
        map1.put("settle1", EnumConstant.SettleVal.SETTLE_VAL1);
        map2.put("settle2", EnumConstant.SettleVal.SETTLE_VAL2);
        map3.put("settle3", EnumConstant.SettleVal.SETTLE_VAL3);
        map4.put("settle4", EnumConstant.SettleVal.SETTLE_VAL4);
        map5.put("settle5", EnumConstant.SettleVal.SETTLE_VAL5);
        map6.put("settle6", EnumConstant.SettleVal.SETTLE_VAL6);
        map7.put("settle7", EnumConstant.SettleVal.SETTLE_VAL7);
        map8.put("settle8", EnumConstant.SettleVal.SETTLE_VAL8);
        map9.put("settle9", EnumConstant.SettleVal.SETTLE_VAL9);
        map10.put("settle10", EnumConstant.SettleVal.SETTLE_VAL10);
        mapList.add(map1);
        mapList.add(map2);
        mapList.add(map3);
        mapList.add(map4);
        mapList.add(map5);
        mapList.add(map6);
        mapList.add(map7);
        mapList.add(map8);
        mapList.add(map9);
        mapList.add(map10);
        return R.ok(mapList);
    }
}
